refactor(nix): migrate from flake-utils to flake-parts#250
Merged
Conversation
Replace flake-utils with flake-parts for a more modular and type-safe Nix flake configuration. flake-parts uses the NixOS module system pattern, providing better extensibility and composability. Key changes: - Replace flake-utils input with flake-parts - Use mkFlake with perSystem pattern instead of eachDefaultSystem - Explicitly declare supported systems (x86_64-linux, aarch64-linux, aarch64-darwin) - Remove x86_64-darwin from supported systems as it is no longer needed Benefits of flake-parts: - NixOS-style module system for flake configuration - Type-safe options with better error messages - Support for advanced features like partitions and flakeModules - More maintainable structure for complex flake configurations
commit: |
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Nix flake configuration by migrating from flake-utils to flake-parts for improved modularity and type safety. The migration adopts the NixOS module system pattern and explicitly declares supported systems.
Key Changes:
- Replaced
flake-utilsdependency withflake-parts - Refactored outputs structure from
eachDefaultSystemtomkFlakewithperSystempattern - Explicitly declared three supported systems (x86_64-linux, aarch64-linux, aarch64-darwin), removing x86_64-darwin
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| flake.nix | Migrated from flake-utils to flake-parts, refactored outputs using mkFlake with explicit system declarations |
| flake.lock | Updated dependency tree to replace flake-utils with flake-parts and nixpkgs-lib |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add nixfmt-rfc-style as a development dependency in the Nix flake and configure lefthook to automatically format .nix files on pre-commit. Uses `nix develop --command` to run nixfmt from the devShell context, ensuring consistent Nix code formatting across the project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the Nix flake configuration from
flake-utilstoflake-partsfor improved modularity and type safety.What Changed
flake-utilsinput withflake-partsmkFlakewithperSystempatternx86_64-linux,aarch64-linux,aarch64-darwinx86_64-darwinsupport (no longer needed)Why
flake-partsprovides several advantages overflake-utils:Summary by cubic
Migrates the Nix flake from flake-utils to flake-parts for a modular, type-safe per-system setup. Adds nixfmt to the dev shell with automatic .nix formatting on pre-commit, and simplifies CI by loading the dev environment in the shared setup-nix action.
Refactors
Dependencies
Written for commit 2c9a8ff. Summary will update automatically on new commits.